home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games: Greatest Hits 1996 / Amiga Games: Greatest Hits 1996.iso / rexx / megalotto.mbrx < prev    next >
Text File  |  1996-07-04  |  2KB  |  76 lines

  1. /*
  2.                        MegaLotto ©1996 Eden Software
  3.                          Written By: Edward Farrow
  4. */
  5. /*
  6. MegaLotto Is A Pretty Useless Utility Unless You Live In The UK! It
  7. Generates 6 Totally Different Numbers Between 1 And 49 (Ideal For The
  8. National Lottery!) It Then Displays Them As A Nice GUI In MegaBook!
  9. Ok So Its Pretty Crap But It Lets You See What You Can Do Within MB!!
  10.  
  11. This Is MBWare, It Is To Be Contained Within The MegaBook Archive And
  12. Can Only Be Distributed If You Distribute It With MegaBook! Please Do
  13. Not Change This File In Anyway!
  14. */
  15.  
  16. /* MegaBook Path Incase Its Not Loaded */
  17. MBPath = 'MegaBook3:MegaBook'
  18.  
  19. /* Line Feed Char. Makes A New Line In Requestors (Ta Tom!) */
  20. LF='0a'x
  21.  
  22. /* ' And " Chars. Makes Requestors Allow ' And " Symbols */
  23. SQ='"';DQ="'"
  24.  
  25. PARSE ARG LINE
  26.  
  27. /* Look For MegaBook, If Its Not Running Run It! =o) */
  28. IF ~show('P', 'MEGABOOK.01') THEN DO
  29.    ADDRESS COMMAND 'run >nil: 'MBPath
  30.       DO 5 WHILE ~show('P', 'MEGABOOK.01')
  31.          'SYS:REXXC/waitforport MEGABOOK.01'
  32.    END
  33. END
  34.  
  35. ADDRESS 'MEGABOOK.01'
  36. OPTIONS RESULTS
  37.  
  38. /* Front GUI */
  39. REQUEST 'MegaLotto v1.00 ©1996 Eden Software'LF'Written By: Edward Farrow'LF'-=-=-=-=-=-=-=-=-=-=-=-=-=-'LF'National Lottery Number Generator' GADS '_Kewl'
  40.  
  41. /* Number Picking Bit (Really Easy!!!!) */
  42. CALL Randu(time('s'))
  43. Ao:
  44.   A = Random(1,49)
  45. Bo:
  46.   Ba = Random(1,49)
  47.   IF Ba=A THEN CALL Bo
  48. Co:
  49.   C = Random(1,49)
  50.   IF C=A THEN CALL Co
  51.   IF C=Ba THEN CALL Co
  52. Do:
  53.   D = Random(1,49)
  54.   IF D=A THEN CALL Do
  55.   IF D=Ba THEN CALL Do
  56.   IF D=C THEN CALL Do
  57. Eo:
  58.   E = Random(1,49)
  59.   IF E=A THEN CALL Eo
  60.   IF E=Ba THEN CALL Eo
  61.   IF E=C THEN CALL Eo
  62.   IF E=D THEN CALL Eo
  63. Fo:
  64.   F = Random(1,49)
  65.   IF F=A THEN CALL Fo
  66.   IF F=Ba THEN CALL Fo
  67.   IF F=C THEN CALL Fo
  68.   IF F=D THEN CALL Fo
  69.   IF F=E THEN CALL Fo
  70.  
  71. /* Generate A GUI With These Numbers! */
  72. REQUEST 'Your Lottery Numbers Are:'LF A Ba C D E F'' GADS '_I'DQ'll Jot Em Down!'
  73.  
  74. /* Quit Properly! */
  75. EXIT 0
  76.